var express = require('express');//, mysql = require('mysql');
var app = require('express').createServer(), io = require('socket.io').listen(app);


app.listen(3000);
console.log('PathNode: http://localhost:3000/');

// Configuration
app.configure(function(){
  app.set('view engine', 'jade');
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(__dirname + '/'));
});
app.configure('development', function(){
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
  app.use(express.errorHandler());
});

//Routes
app.get('/', function (req, res) {
  //res.sendfile(__dirname + '/nodeviews/senhaadm.html');
});


io.sockets.on('connection', function (socket) {
	
	socket.on('chamarsenha', function(filaid){
		io.sockets.emit('updatesenha', filaid);
	});

	socket.on('disconnect', function(){
		console.log('DISCONNECT: ')
		console.log(socket.handshake.address)
	});
});